<template>
  <div>
    <div style="height: 40px">
      <h1 style="float: left">医院详情</h1>
      <el-button style="float: right" @click="back">返回</el-button>
      <div style="clear: both"></div>
    </div>
    <div>
      <table  border=1 cellpadding=8 cellspacing=0 style="margin-left: 0px; width: 100%" >
        <tr>
          <td colspan = "5">基本信息</td>
        </tr>
        <tr>
          <td rowspan="5" style="width:140px; padding: 0px 0px 0px 0px">
            <img :src="imageUrl" style="width:140px; margin: 0px" >
          </td>
          <td>ID</td>
          <td>{{ doctor.id }}</td>
          <td>医院名称</td>
          <td>{{ doctor.name }}</td>
        </tr>
        <tr>
          <td>是否推荐</td>
          <td>{{ doctor.isRec }}</td>
          <td>医院人数</td>
          <td>{{ doctor.doctorNumber}}</td>
        </tr>
        <tr>
          <td>科室数</td>
          <td>{{ doctor.depTmNumber }}</td>
          <td>所在地区</td>
          <td>{{ doctor.region }}</td>
        </tr>
        <tr>
          <td>详细地址</td>
          <td>{{ doctor.addr }}</td>
          <td>医院电话</td>
          <td>{{ doctor.phone }}</td>
        </tr>
      </table>
    </div>
<!--    <div style="border: solid 1px #ebebeb;">-->
<!--      <div style="height: 45px; background-color: #f2f2f2; padding: 10px 0px 0px 10px">-->
<!--        擅长-->
<!--      </div>-->
<!--      <div style="height: 60px; padding: 30px 0px 0px 10px">-->
<!--        {{ doctor.googAt }}-->
<!--      </div>-->
<!--    </div>-->

    <div style="border: solid 1px #ebebeb;">
      <div style="height: 45px; background-color: #f2f2f2; padding: 10px 0px 0px 10px">
        简介
      </div>
      <div style=" padding: 10px 0px 10px 10px">
        {{doctor.resume}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "HospitalInfo",
  data() {
    return {
      doctor: null,
      // 图片问诊
      GraphicConsultation: '',
      // 电话问诊
      TelephoneConsultation: '',
      // 视频问诊
      VideoConsultation: '',
      // 极速问诊
      SpeedyConsultation: '',
      // 挂号预约
      RegisterAppointment: '',
      // 复诊开药
      Prescribe: '',
      //头像地址
      imageUrl: '',
    };
  },
  methods: {
    back(){
      this.$router.go(-1)
    }
  },
  created() {
    this.doctor = this.$route.params.doctor
    this.imageUrl = "http://localhost:9527" +this.doctor.imgUrl

    this.$axios({
      method: 'GET',
      url: '/server/get/server',
      params: {
        id: this.doctor.id
      }
    }).then((data) => {
      let temp = data.data.data
      temp.forEach((obj) => {
        if (obj.consultType === '图文问诊') {
          this.GraphicConsultation = obj
        }else if (obj.consultType === '电话问诊') {
          this.TelephoneConsultation = obj
        }else if (obj.consultType === '视频问诊') {
          this.VideoConsultation = obj
        }else if (obj.consultType === '极速问诊') {
          this.SpeedyConsultation = obj
        }else if (obj.consultType === '挂号预约') {
          this.RegisterAppointment = obj
        }else if (obj.consultType === '复诊开药') {
          this.Prescribe = obj
        }
      })
    })
  }
}
</script>

<style scoped>

</style>
